/*
package com.wwy.monitor.config;

import java.sql.SQLException;
import java.util.Arrays;

import com.taobao.tddl.client.sequence.impl.GroupSequence;
import com.taobao.tddl.client.sequence.impl.GroupSequenceDao;
import com.taobao.tddl.common.exception.TddlException;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class SequenceConfig {

    @Bean(name = "sequenceDao")
    public GroupSequenceDao createSequenceDao(@Value("${spring.sequence.appName}") String appName,
                                              @Value("${spring.sequence.dsCount}") int dsCount,
                                              @Value("${spring.sequence.dbGroupKeys}") String dbGroupKeys,
                                              @Value("${spring.sequence.adjust}") boolean adjust,
                                              @Value("${spring.sequence.retryTimes}") int retryTimes)
            throws TddlException {
        GroupSequenceDao sequenceDao = new GroupSequenceDao();
        sequenceDao.setAppName(appName);
        sequenceDao.setDscount(dsCount);
        String[] keysArray = dbGroupKeys.split(",");
        sequenceDao.setDbGroupKeys(Arrays.asList(keysArray));
        sequenceDao.setAdjust(adjust);
        sequenceDao.setRetryTimes(retryTimes);
        sequenceDao.init();
        return sequenceDao;
    }

    @Bean(name = "monitorLogSequence")
    public GroupSequence createAjxBasicSequence(@Qualifier("sequenceDao") GroupSequenceDao sequenceDao, @Value("${spring.sequence.monitorLog}") String ajxName)
            throws SQLException {
        return init(ajxName, sequenceDao);
    }

    private GroupSequence init(String name, GroupSequenceDao sequenceDao) throws SQLException {
        GroupSequence sequence = new GroupSequence();
        sequence.setName(name);
        sequence.setSequenceDao(sequenceDao);
        sequence.init();
        return sequence;
    }
}
*/
